package com.esisa.swing;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;

import com.esisa.listners.Alpha;
import com.esisa.listners.CopyPastListner;
import com.esisa.listners.ExitAction;

public class Test extends JFrame {
	
	
	public Test() {
		exp01();
		setSize(400, 300);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setVisible(true);
	}
	
	void exp01(){
		Form f=new Form(new String[]{"nom","prenom","age","adresse","oussma","nadir"});
		f.addMouseListener(new CopyPastListner());
		f.AddKeyListner("age :", new Alpha());
		JPanel paneau=new JPanel();
		paneau.setLayout(new BorderLayout());
		paneau.add(f);
		ButtonPanel b=new ButtonPanel(new String[]{"Enregistrer","Load","Quitter"});
		b.addActionListner(new ExitAction(), "Quitter");
		//b.addActionListner(new Save("resources/file01.txt", f), "Enregistrer");
		//b.addActionListner(new Load("resources/file01.txt", f), "Load");
		paneau.add(b, "South");
		setContentPane(paneau);
	}
	


	public static void main(String[] args) {
		new Test();

	}

}
